﻿<?xml version="1.0" encoding="utf-8" ?>
<hibernate-mapping xmlns="urn:nhibernate-mapping-2.2"
                assembly="Inovout.Cloud.Application"
				        namespace="Inovout.Cloud.Application.Security">
  <class name="ApplicationUser" table="Application_ApplicationUser">
    <id name="Id" access="field.camelcase"
        column="ApplicationUserId" type="Int32">
      <generator class="native" />
    </id>
    <many-to-one name="Application"  column="PublicApiAccessCredentiaId" foreign-key="FK_Application_PublicApiAccessCredential_PublicApiAccessCredentiaId_Application_Application_ApplicationId"  class="Inovout.Cloud.Application.Domain.Application"  cascade="all" />
    <property name="Name" />
    <set name="Credentials" table="Application_ApplicationUser_Credential">
      <key column="ApplicationUserId"/>
      <many-to-any id-type="System.Int32"
    			meta-type="System.String">
        <meta-value value="BrowserApplicationCredential" class="Inovout.Cloud.Application.Security.BrowserApplicationCredential"/>
        <meta-value value="NativeApplicationCredential" class="Inovout.Cloud.Application.Security.NativeApplicationCredential"/>
        <meta-value value="ServerApplicationCredential" class="Inovout.Cloud.Application.Security.ServerApplicationCredential"/>
        <meta-value value="WebApplicationCredential" class="Inovout.Cloud.Application.Security.WebApplicationCredential"/>
        <column name="CredentialType" not-null="true"/>
        <column name="ApplicationCredentialId" not-null="true"/>
      </many-to-any>
    </set>
    <property name="CreatedTime" access="field.camelcase" />
    <property name="CreatedUserName" access="field.camelcase"/>
    <property name="ModifiedTime" access="field.camelcase"/>
    <property name="ModifiedUserName" access="field.camelcase"/>
    <property name="AccessedTime" access="field.camelcase"/>
    <property name="AccessedUserName" access="field.camelcase"/>
    <property name="Memo" />
    <property name="IsInvalid" />
  </class>
</hibernate-mapping>
<!--Styles["all"] = All;
Styles["all-delete-orphan"] = AllDeleteOrphan;
Styles["save-update"] = Update;
Styles["persist"] = Persist;
Styles["merge"] = Merge;
Styles["lock"] = Lock;
Styles["refresh"] = Refresh;
Styles["replicate"] = Replicate;
Styles["evict"] = Evict;
Styles["delete"] = Delete;
Styles["remove"] = Delete; // adds remove as a sort-of alias for delete...
Styles["delete-orphan"] = DeleteOrphan;
Styles["none"] = None;-->


